Building Queries

IQA provides two modes for query definition: Basic and Advanced. The general steps for defining a query are the same in either mode, but additional functionality is available in Advanced mode. Use Basic mode for querying and displaying simple lists of results from one or more sources with optional filters to narrow the results. Use Advanced mode for more complex queries and displays.

Note: iMIS starts you in Basic mode, but it remembers the last mode you were in, even after you log out.

Basic Mode

Advanced Mode

□     Define sources and (optional) filters

□     Specify display details

□     Use calculations, such as sums and averages

□     Use queries in iMIS searches

□     Use SQL expressions in queries

□     Use complex filters, such as displaying only unique results

□     Allow or require end user to supply parameters at run time

□     Aggregate data and display

□     Assign aliases to field names for display

□     Link a display property to another page

See Reporting in IQA for information about using queries for reports.

Essential of query definition

1.  Define the query mode

Define the query as Basic or Advanced, depending on complexity. Use Basic mode for simple queries without calculations like sums and averages or SQL expressions.

2.  Name the query

Follow a structured naming convention to make queries easier to locate. See Building a library of queries for guidelines.

3.  Add source(s) for the query

Add one or more sources (business objects and/or queries) for the query. For example, you could set up a query based on the Contacts business object alone, or on both Contacts and Activities, or on a previous query with an additional source.

4.  Use existing relationships between sources or create new ones.

If you have chosen more than one source for your query, there must be relationships among them. The most common relationships are used by default. However, you might need to create new ones. You can associate business objects and queries through fields that contain the same data.

To make user-defined tables available as sources in IQA, have your system administrator publish them in Tools> User Defined Tables. Whenever a new custom table is added or updated, the system administrator should re-publish the tables.

5.  Set filters to narrow query results

Use logical operators (such as equal, not equal, and between) to refine query results.

6.  Select the columns to display

You can select the columns you want to display from the sources you have selected and the order in which you want the columns to appear.

7.  Define the sorting order of the columns

You can order and prioritize the properties in each column in ascending or descending order.

8.  Test the query

It is important to test the query and edit it, if necessary, to make sure the desired results are returned.

9.  Modify security access to the query

You can modify the security on a filter to assign read, write, and run privileges.

10. Save the query to an appropriate folder

To save a valid query, you must select at least one source and one column. If you select more than one source, the relationship between them must be defined. In most cases, a default relationship is inherited from your sources.

Tips for building queries

■    Review information on Business Objects to help select the appropriate objects for your query.

■    Base the structure and location for your query file/folder on the needs and access levels of your users. See Building a library of queries for information and hints.

■    Start with a single source object and add additional objects as needed.

■    Some attributes (relations, default columns, default column order) are inherited from the sources you select. You can modify these default settings during query definition/editing.